package cloudspace.vm.filesystem;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;

import cloudspace.security.CloudController;


public class CSPathInputStream extends InputStream
{
    public CSPathInputStream( CSPath path ) throws FileNotFoundException
    {
        CloudController.checkRead( path );

        stream = new FileInputStream( path.getPhysicalFile() );
    }


    @Override
    public int read() throws IOException
    {
        return stream.read();
    }


    public void close() throws IOException
    {
        stream.close();
    }

    private FileInputStream stream;
}
